package com.dongqi.myblog.util;

import com.dongqi.myblog.po.TBlogTag;

import java.util.List;

public class MyStringUtils {

    /**
     * 将tags list转换成"a,b,c"这种格式的字符串
     */
    public static String getTagIds(List<TBlogTag> list){
        StringBuffer buffer = new StringBuffer("");
        if (list!=null){
            for(TBlogTag b:list){
                buffer.append(b.getTagId());
                buffer.append(',');
            }
            if (buffer.length()>1){
                buffer.deleteCharAt(buffer.length()-1);
            }
        }
        return buffer.toString();
    }

}
